﻿using System;
using System.Web.Mvc;

public static class Helpers
{
    public static string Image(this UrlHelper helper, string fileName)
    {
        return helper.Content("~/assets/images/{0}".FormatWith(fileName));
    }

    public static string Stylesheet(this UrlHelper helper, string fileName)
    {
        return helper.Content("~/assets/stylesheets/{0}".FormatWith(fileName));
    }

    public static string JsScript(this UrlHelper helper, string fileName)
    {
        return helper.Content("~/Scripts/{0}".FormatWith(fileName));
    }

    public static string NoIcon(this UrlHelper helper)
    {
        return Image(helper, "noIcon.png");
    }

    public static string FormatWith(this string format, params object[] args)
    {
        if (format == null) throw new ArgumentNullException("format"); return string.Format(format, args);
    }

    public static string FormatWith(this string format, IFormatProvider provider, params object[] args)
    {
        if (format == null) throw new ArgumentNullException("format");
        return string.Format(provider, format, args);
    }
}